home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / screen-profiles / screen-launcher-install next >
Encoding:
Text File  |  2009-04-08  |  1.4 KB  |  43 lines

  1. #!/bin/sh -e
  2. #
  3. #    screen-launcher-install
  4. #    Copyright (C) 2008 Canonical Ltd.
  5. #
  6. #    Authors: Nick Barcet <nick.barcet@ubuntu.com>
  7. #             Dustin Kirkland <kirkland@canonical.com>
  8. #
  9. #    This program is free software: you can redistribute it and/or modify
  10. #    it under the terms of the GNU General Public License as published by
  11. #    the Free Software Foundation, version 3 of the License.
  12. #
  13. #    This program is distributed in the hope that it will be useful,
  14. #    but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. #    GNU General Public License for more details.
  17. #
  18. #    You should have received a copy of the GNU General Public License
  19. #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
  20.  
  21.  
  22. install_screen_launcher() {
  23.     dest=$1
  24.     launcher="/usr/bin/screen-launcher"
  25.     launcher_line="[ -x $launcher ] && $launcher"
  26.     # Add it at the end
  27.     echo "$launcher_line" >> "$dest"
  28. }
  29.  
  30. # Sanitize the environment
  31. /usr/share/screen-profiles/screen-launcher-uninstall || true
  32.  
  33. # Install in $HOME/.profile unconditionally
  34. install_screen_launcher "$HOME/.profile"
  35.  
  36. # Now, install in any shell-specific profiles, if they exist
  37. # This list may grow to support other shells
  38. for i in ".bash_profile" ".bash_login"; do
  39.     if [ -w "$HOME/$i" ]; then
  40.         install_screen_launcher "$HOME/$i"
  41.     fi
  42. done
  43.